<?php
  function putHTML($array)
  {

    $fp = fopen('data.php', 'w+');
    if ($fp) {
      fputs($fp,"<?php\n");

      foreach ($array as $val) {
        fputs($fp,$val."\n");
      }
      fclose($fp);
    } else {
      die("Error while opening: " . $page);
    }
  }
$arr = array(
'$num = 123456;',
'echo $num;',
'echo date("Y-m-d h:i:s")',
);
putHTML($arr);


